home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / IIGS / TN.IIGS.092 < prev    next >
Encoding:
Text File  |  1991-11-15  |  4.3 KB  |  102 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. Apple IIgs
  7. #92:    Twisted Tales of TextEdit
  8.  
  9. Revised by:     Dave Lyons                                      December 1991
  10. Written by:     C.K. Haun <TR> and Dave Lyons                  September 1990
  11.  
  12. This Technical Note discusses some undocumented features and some bugs 
  13. in the TextEdit tool set through System Software 5.0.4.
  14. Changes since November 1990:  Noted that a non-control TENew 
  15. creates a Text Edit record for the current port.
  16. _____________________________________________________________________________
  17.  
  18. TENew
  19.  
  20. TextEdit records you create with TENew are always tied to the current 
  21. port at the time of the TENew call, whether or not the fNotControl bit 
  22. is set.  (For TextEdit controls, NewControl2 is the preferred call.)
  23.  
  24. TEInsert
  25.  
  26. Using the TEInsert call on an invisible TextEdit record causes the screen to
  27. scroll, exactly as if the TextEdit record were visible.
  28.  
  29. If you use LETextBox2 style text as input for a TEInsert call, any style change
  30. information contained at the end of the LETextBox2 text is ignored.  To ensure
  31. that the style change is not ignored, append an additional character at the end
  32. of the block, then delete (with TESetSelect and TEDelete) the extra character
  33. after the TEInsert call.
  34.  
  35. TEGetText
  36.  
  37. The documentation for TEGetText says that a dataFormat value of $4 returns the
  38. text as "Formatted for input to LineEdit LETextBox2".  This is not a reliable
  39. return method-this call may or may not succeed.  Greater chance for success
  40. occurs with less than 4,000 characters in the TextEdit record.
  41.  
  42. TEGetText also supports getting just the text of the current selection range.
  43. Adding $0020 (onlyGetSelection) to the number passed in bufferDescriptor
  44. returns the text of the current selection.  This technique does not work with
  45. data format LETextBox2, but does work with all other formats.  Also, there is
  46. no corresponding bit for the associated style record, so you cannot get the
  47. style for just the current selection this way, if you request style information
  48. you get a styleRef for the entire TextEdit record.
  49.  
  50. TEClick
  51.  
  52. Using TEClick or TestControl on an inactive record currently causes that record
  53. to activate.
  54.  
  55. TERuler
  56.  
  57. Pixel tabbing values must all be greater than zero or TextEdit loops infinitely
  58. on a tab.
  59.  
  60. TEGetRuler & TESetRuler
  61.  
  62. TERuler, for the default ruler or any ruler that uses a tabType value of $1
  63. returns a ruler four bytes longer than described in the documentation.  The
  64. extra four bytes are all $FF, and they are the terminator characters for
  65. tabType $2 rulers.  Expand your buffers by four bytes to prevent overwriting
  66. any data.  TextEdit also expects the additional information on a TESetRuler
  67. call, so you should pad your ruler with four $FF bytes if you are using a type
  68. $1 ruler.
  69.  
  70. TESetText
  71.  
  72. Passing a zero-length class one input string (a word length string with the
  73. word set to zero) to TESetText causes TextEdit to crash.
  74.  
  75. TEPaintText
  76.  
  77. TEPaintText currently prints colored text in only four colors.
  78.  
  79. It's Not Dirty, It's Text
  80.  
  81. There has been some confusion about determining if a TextEdit record has been
  82. changed.  The documentation has been a little vague, and the process itself has
  83. mislead some people.  Here is The Truth:  there is a TextEdit dirty flag, and
  84. you can use it and rely on it to tell you when a TextEdit record has changed.
  85.  
  86. The TextEdit dirty flag is bit 6 (fRecordDirty in the E16.TextEdit interface
  87. file) of the ctlFlag byte.  This has caused some confusion because the ctlFlag
  88. byte is at offset $12 in the control definition template, and it is at offset
  89. $10 in the TextEdit or Control record.  Just remember that it is not in the
  90. same place in the record as it is in the template.
  91.  
  92. If it is set, then the TextEdit or Control record has been changed since the
  93. last time the dirty bit was cleared.  The dirty bit is clear initially when you
  94. create the TextEdit or Control record.  Anytime after that, if the user enters
  95. text into the TextEdit record, TextEdit sets the dirty flag.  It is up to your
  96. application to clear the dirty flag; TextEdit has no way of knowing when you've
  97. saved or cleared data.
  98.  
  99. Further Reference
  100. _____________________________________________________________________________
  101.   o  Apple IIgs Toolbox Reference, Volume 3
  102.